package com.rockbb.common.utilities.i18n;

import java.util.List;
import java.util.Map;

public class LocaleContent implements java.io.Serializable 
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Map<String,String> locales;

	public LocaleContent(List<Language> languages) {
		this.locales = LanguageUtil.extractLocales("", languages);
	}

	public LocaleContent(String value, List<Language> languages) {
		this.locales = LanguageUtil.extractLocales(value, languages);
	}

	public String getLocale(String langName) {
		return locales.get(langName);
	}

	public void setLocale(String langName, String locale) {
		locales.put(langName, locale);
	}

	public Map<String, String> getLocales() {
		return locales;
	}

	public String toString() {
		return LanguageUtil.compressLocales(locales);
	}
}